package ajax.quanxuan.sys.dao;

import ajax.quanxuan.sys.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author KazuGin
 * @since 2024-07-04
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {
    @Delete("delete  from sys_role_permission where  pid =#{id}")

    void deleteRolePermissionByPid(Serializable id);
    @Select("select  pid from sys_role_permission where rid = #{roleId} ")
    List<Integer> findRolePermissionByRoleId(int roleId);
    List<Permission> list(Permission permission);
    List<Permission> listAll(Permission permission);
    List<Permission> listMun(Permission permission);

    List<Permission> listMunleft(Permission permission);
    List<Permission> listPermission(Permission permission);

    List<Permission> listrolemun(String pidlist);
    Integer countmenu (Permission permission);

    Integer countPermission (Permission permission);

    List<Permission> listPermissiontrerr(Permission permission);
    List<Permission> findById(String pidlist);
}
